<%@ page contentType="text/html; charset=UTF-8" language="java"  errorPage="" %>
<%@page import="com.bban.util.StringUtil"%>
<%@page import="java.util.*"%>
<%@page import="com.bban.dto.vo.*"%>
<%@page import="com.bban.db.dao.*"%>
<%@page import="com.bban.bo.*"%>
<%@page import="com.bban.entry.UserCenter2"%>
<%@page import="com.bban.util.cfg.DBCfg"%>
<%@page import="com.bban.dto.base.Msg"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>回放目标轨迹</title>
<link rel='STYLESHEET' type='text/css' href='js/codebase/common/style.css'>
<script type="text/javascript" src="js/My97DatePicker/WdatePicker.js" ></script>

</head>
<%
     	String objectID = request.getParameter("objectID");
  
  if(StringUtil.isNullOrEmpty(objectID)){
	  objectID = (String)session.getAttribute("eBabyID");
  }
          	LocationMgr lm = new LocationMgr();
          	GPSVO vo = lm.getTheNewestOne(objectID);
      
          	java.text.SimpleDateFormat   myFmt=new   java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
          	String initTo = null;
          	if(vo != null)
          		initTo = vo.getDATETIME();
          	else
          		initTo = myFmt.format(new Date());
          	
          	
          	Date date = StringUtil.getDateByStr(initTo);
          	
     		Calendar cal = Calendar.getInstance();
     		cal.setTime(date);
     		Calendar cal2 = (Calendar)cal.clone();
     		cal2.set(Calendar.HOUR_OF_DAY, cal.get(Calendar.HOUR_OF_DAY) - 1);
     		//java.text.SimpleDateFormat   myFmt=new   java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
     		String initFrom = myFmt.format(cal2.getTime());
     		//String initTo = myFmt.format(date);
     %>
<body >
<table>


<tr>
<td valign="top" align="center">回放目标 <%=UserCenter2.getInstance().getUserName(objectID) %> 从：

   <input TYPE="text" NAME="from" value="" id="from"  readonly onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" />
  到：
  <input TYPE="text" NAME="to" value="" id="to"      readonly onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate" />
  

  频    率：
  
  <select name="freq" id="freq">
    <option value="10000">正常-10</option>
    <option value="5000">2倍正常-5</option>
    <option value="3000">快-3</option>
    <option value="1000">比较快-1</option>
    <option value="500" >很快-0.5</option>
    <option value="100" selected>非常快-0.1</option>
    <option value="10">快得不得了</option>
  </select>
  秒
  <input name="command" id="command" onClick="mapFrame.load();" disabled = "true" type="button" value="开始回放" />
  
  <input name="objectID" type="hidden" id="objectID" value="<%=objectID %>"/>
  <input name="initFrom" type="hidden" id="initFrom" value="<%=initFrom %>"/>
  <input name="initTo" type="hidden" id="initTo" value="<%=initTo %>"/></td>
</tr>



</table>

<div>
<iframe frameborder="0" id="mapFrame" name="mapFrame" scrolling=auto src="track-history-map.html?objectID=<%=request.getParameter("objectID")%>" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 2"> 
</iframe>
</div>


</body>     
</html>
     
     <script type="text/javascript">
     var initFrom = document.getElementById("from").value;
     if(initFrom == "")
    	 document.getElementById("from").value = document.getElementById("initFrom").value;

     var initTo = document.getElementById("to").value;
     if(initTo == "")
    	 document.getElementById("to").value = document.getElementById("initTo").value;	 
     </script>

